package cn.inbot.shopadmin.app;

import cn.inbot.lib.framework.PBAppEnviroment;
import cn.inbot.lib.util.SPUtil;

/**
 * Created by shisenkun on 2021/5/10.
 */
public class AppCacheData {

    private static String KEY_PREFIX = "";

    static {
        if (PBAppEnviroment.INSTANCE.isProduct()) {
            KEY_PREFIX = "product_";
        } else {
            KEY_PREFIX = "test_";
        }
    }

    private static final String KEY_LAST_LOGIN_RESULT_JSON = KEY_PREFIX + "key_last_login_result_json";
    private static final String KEY_LAST_LOGIN_USERNAME = KEY_PREFIX + "key_last_login_username";
    private static final String KEY_LAST_LOGIN_PASSWORD = KEY_PREFIX + "key_last_login_password";

    public static String getLastLoginResultJson() {
        return SPUtil.INSTANCE.getString(KEY_LAST_LOGIN_RESULT_JSON);
    }

    public static void setLastLoginResultJson(String json) {
        SPUtil.INSTANCE.putString(KEY_LAST_LOGIN_RESULT_JSON, json);
    }

    public static String getLastLoginUsername() {
        return SPUtil.INSTANCE.getString(KEY_LAST_LOGIN_USERNAME);
    }

    public static void setLastLoginUsername(String json) {
        SPUtil.INSTANCE.putString(KEY_LAST_LOGIN_USERNAME, json);
    }

    public static String getLastLoginPassword() {
        return SPUtil.INSTANCE.getString(KEY_LAST_LOGIN_PASSWORD);
    }

    public static void setLastLoginPassword(String json) {
        SPUtil.INSTANCE.putString(KEY_LAST_LOGIN_PASSWORD, json);
    }


}
